<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  <meta name="baidu-site-verification" content="L6Lm9d5Crl">
  
  
  
  
  <title>稀疏数组(sparsearray) | TimeSilence</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="实际问题：编写五子棋程序中，有存盘退出和序上盘的功能。 所以我们用二维数组记录棋盘信息，但是二维数组的很多值默认是0，因此记录了很多没有意义的数据，因此使用稀疏数组来压缩二维数组。">
<meta property="og:type" content="website">
<meta property="og:title" content="稀疏数组(sparsearray)">
<meta property="og:url" content="http://yoursite.com/algorithm/sparsearray.html">
<meta property="og:site_name" content="TimeSilence">
<meta property="og:description" content="实际问题：编写五子棋程序中，有存盘退出和序上盘的功能。 所以我们用二维数组记录棋盘信息，但是二维数组的很多值默认是0，因此记录了很多没有意义的数据，因此使用稀疏数组来压缩二维数组。">
<meta property="og:locale" content="en">
<meta property="og:updated_time" content="2019-08-26T14:53:31.852Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="稀疏数组(sparsearray)">
<meta name="twitter:description" content="实际问题：编写五子棋程序中，有存盘退出和序上盘的功能。 所以我们用二维数组记录棋盘信息，但是二维数组的很多值默认是0，因此记录了很多没有意义的数据，因此使用稀疏数组来压缩二维数组。">
  
    <link rel="alternative" href="/atom.xml" title="TimeSilence" type="application/atom+xml">
  
  
    <link rel="icon" href="/img/002.jpg">
  
  
  <link rel="stylesheet" href="//cdn.bootcss.com/animate.css/3.5.0/animate.min.css">
  
  <link rel="stylesheet" href="/css/style.css">
  <link rel="stylesheet" href="/font-awesome/css/font-awesome.min.css">
  <link rel="apple-touch-icon" href="/apple-touch-icon.png">
  
  
      <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  
  <!-- 加载特效 -->
    <script src="/js/pace.js"></script>
    <link href="/css/pace/pace-theme-flash.css" rel="stylesheet">
  <script>
      var yiliaConfig = {
          fancybox: true,
          animate: true,
          isHome: false,
          isPost: false,
          isArchive: false,
          isTag: false,
          isCategory: false,
          open_in_new: false
      }
  </script>
</head></html>
<body>
  <div id="container">
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
    <header id="header" class="inner">
        
<script src="https://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js"></script>

        <a href="/" class="profilepic">
            
            <img lazy-src="/img/001.jpg" class="js-avatar">
            
        </a>
        <hgroup>
          <h1 class="header-author"><a href="/">TimeSilence</a></h1>
        </hgroup>
        
        
            <form>
                <input type="text" class="st-default-search-input search" id="local-search-input" placeholder="搜索一下" autocomplete="off">
            </form>
            <div id="local-search-result"></div>
        
        
            <script type="text/javascript">
                (function() {
                    'use strict';
                    function getMatchData(keyword, data) {
                        var matchData = [];
                        for(var i =0;i<data.length;i++){
                            if(data[i].title.toLowerCase().indexOf(keyword)>=0) 
                                matchData.push(data[i])
                        }
                        return matchData;
                    }
                    var $input = $('#local-search-input');
                    var $resultContent = $('#local-search-result');
                    $input.keyup(function(){
                        $.ajax({
                            url: '/search.json',
                            dataType: "json",
                            success: function( json ) {
                                var str='<ul class=\"search-result-list\">';                
                                var keyword = $input.val().trim().toLowerCase();
                                $resultContent.innerHTML = "";
                                if ($input.val().trim().length <= 0) {
                                    $resultContent.empty();
                                    $('#switch-area').show();
                                    return;
                                }
                                var results = getMatchData(keyword, json);
                                if(results.length === 0){
                                    $resultContent.empty();
                                    $('#switch-area').show();
                                    return;
                                } 
                                for(var i =0; i<results.length; i++){
                                    str += "<li><a href='"+ results[i].url +"' class='search-result-title'>"+ results[i].title +"</a></li>";
                                }
                                str += "</ul>";
                                $resultContent.empty();
                                $resultContent.append(str);
                                $('#switch-area').hide();
                            }
                        });
                    });
                })();
            </script>
        
        
            <div id="switch-btn" class="switch-btn">
                <div class="icon">
                    <div class="icon-ctn">
                        <div class="icon-wrap icon-house" data-idx="0">
                            <div class="birdhouse"></div>
                            <div class="birdhouse_holes"></div>
                        </div>
                        <div class="icon-wrap icon-ribbon hide" data-idx="1">
                            <div class="ribbon"></div>
                        </div>
                        
                        <div class="icon-wrap icon-link hide" data-idx="2">
                            <div class="loopback_l"></div>
                            <div class="loopback_r"></div>
                        </div>
                        
                        
                        <div class="icon-wrap icon-me hide" data-idx="3">
                            <div class="user"></div>
                            <div class="shoulder"></div>
                        </div>
                        
                    </div>
                </div>
                <div class="tips-box hide">
                    <div class="tips-arrow"></div>
                    <ul class="tips-inner">
                        <li>菜单</li>
                        <li>标签</li>
                        
                        <li>友情链接</li>
                        
                        
                        <li>关于我</li>
                        
                    </ul>
                </div>
            </div>
        
        <div id="switch-area" class="switch-area">
            <div class="switch-wrap">
                <section class="switch-part switch-part1">
                    <nav class="header-menu">
                        <ul>
                        
                            <li><a href="/archives/">所有文章</a></li>
                        
                            <li><a href="/algorithm/">算法学习</a></li>
                        
                            <li><a href="/about/">关于我</a></li>
                        
                            <li><a href="/tags">静心阅读</a></li>
                        
                        </ul>
                    </nav>
                    <nav class="header-nav">
                        <ul class="social">
                            
                                <a class="fl github" target="_blank" href="https://github.com/whyzxmsodiao" title="github">github</a>
                            
                                <a class="fl weibo" target="_blank" href="/xxxxxxxx" title="weibo">weibo</a>
                            
                                <a class="fl rss" target="_blank" href="/atom.xml" title="rss">rss</a>
                            
                        </ul>
                    </nav>
                </section>
                
                <section class="switch-part switch-part2">
                    <div class="widget tagcloud" id="js-tagcloud">
                        <a href="/tags/Java-EE/" style="font-size: 10px;">Java EE</a> <a href="/tags/javaee/" style="font-size: 10px;">javaee</a> <a href="/tags/jdbc/" style="font-size: 10px;">jdbc</a> <a href="/tags/作品/" style="font-size: 10px;">作品</a> <a href="/tags/基础/" style="font-size: 10px;">基础</a> <a href="/tags/算法/" style="font-size: 20px;">算法</a> <a href="/tags/遇到的问题/" style="font-size: 15px;">遇到的问题</a> <a href="/tags/随笔/" style="font-size: 15px;">随笔</a>
                    </div>
                </section>
                
                
                <section class="switch-part switch-part3">
                    <div id="js-friends">
                    
                      <a target="_blank" class="main-nav-link switch-friends-link" href="/www.baidu.com">百度一下</a>
                    
                    </div>
                </section>
                
                
                
                <section class="switch-part switch-part4">
                
                    <div id="js-aboutme">菜鸟一匹</div>
                </section>
                
            </div>
        </div>
    </header>
</div>

    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
      <div class="overlay">
          <div class="slider-trigger"></div>
          <h1 class="header-author js-mobile-header hide"><a href="/" title="回到主页">TimeSilence</a></h1>
      </div>
    <div class="intrude-less">
        <header id="header" class="inner">
            <a href="/" class="profilepic">
                
                    <img lazy-src="/img/001.jpg" class="js-avatar">
                
            </a>
            <hgroup>
              <h1 class="header-author"><a href="/" title="回到主页">TimeSilence</a></h1>
            </hgroup>
            
            <nav class="header-menu">
                <ul>
                
                    <li><a href="/archives/">所有文章</a></li>
                
                    <li><a href="/algorithm/">算法学习</a></li>
                
                    <li><a href="/about/">关于我</a></li>
                
                    <li><a href="/tags">静心阅读</a></li>
                
                <div class="clearfix"></div>
                </ul>
            </nav>
            <nav class="header-nav">
                <div class="social">
                    
                        <a class="github" target="_blank" href="https://github.com/whyzxmsodiao" title="github">github</a>
                    
                        <a class="weibo" target="_blank" href="/xxxxxxxx" title="weibo">weibo</a>
                    
                        <a class="rss" target="_blank" href="/atom.xml" title="rss">rss</a>
                    
                </div>
            </nav>
        </header>
    </div>
</nav>
      <div class="body-wrap"><article id="page-" class="article article-type-page" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/algorithm/sparsearray.html" class="article-date">
      <time datetime="2019-03-18T02:18:03.000Z" itemprop="datePublished">2019-03-18</time>
</a>

    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      稀疏数组(sparsearray)
    </h1>
  


      </header>
      
      <div class="article-info article-info-post">
        

        
        <div class="clearfix"></div>
      </div>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
              <style>
    .article-meta {
        display: none;
    }
    #container .article .article-title {
        padding-right: 0;
    }
    .article-header {
        padding: 0;
        padding-top: 26px;
        border-left: none;
        text-align: center;
    }
    .article-header:hover {
        border-left: none;
    }
    .article-title {
        font-size: 1.6em
    }
    .article-meta {
        display: none;
    }
    .article-entry hr {
        margin: 0;
    }
    #container .article-info-post.article-info {
      display: none;
      }
    #container .article .article-title {
    padding: 0;
    }
</style>


          
        <p> 实际问题：编写五子棋程序中，有存盘退出和序上盘的功能。<br> 所以我们用二维数组记录棋盘信息，但是二维数组的很多值默认是0，因此记录了很多没有意义的数据，因此使用稀疏数组来压缩二维数组。<br><a id="more"></a><br> 基本介绍<br>当一个数组中大部分元素为0，或者为同一个值的数组时，可以使用稀疏数组来保存该数组。<br>稀疏数组的处理方法是：<br>1.记录数组一共有几行几列，有多少个不同的值（稀疏数组共三列：行，列，值。第一行记录原始二维数组共几行几列和多少个值）<br>2.把具有不同值的元素的行列及值记录在一个小规模数组中，从而缩小程序规模</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br></pre></td><td class="code"><pre><span class="line">public class SparseArray &#123;</span><br><span class="line"></span><br><span class="line">	public static void main(String[] args) &#123;</span><br><span class="line">		// 先创建一个原始的二位数组11*11</span><br><span class="line">		// 0表示没有棋子，1表示黑子，2表示白子</span><br><span class="line">		int chess[][] = new int[11][11];</span><br><span class="line">		chess[1][2] = 1;</span><br><span class="line">		chess[2][3] = 2;</span><br><span class="line">		chess[4][5] = 2;</span><br><span class="line">		System.out.println(<span class="string">"原始二维数组："</span>);</span><br><span class="line">		<span class="keyword">for</span> (int[] row : chess) &#123;</span><br><span class="line">			<span class="keyword">for</span> (int data : row) &#123;</span><br><span class="line">				System.out.print(<span class="string">" "</span> + data);</span><br><span class="line">			&#125;</span><br><span class="line">			System.out.println();</span><br><span class="line">		&#125;</span><br><span class="line">      //将原始数组转为稀疏数组</span><br><span class="line">		//先遍历原始数组</span><br><span class="line">		int sum=0;</span><br><span class="line">		<span class="keyword">for</span>(int i=0;i&lt;11;i++) &#123;</span><br><span class="line">			<span class="keyword">for</span>(int j=0;j&lt;11;j++) &#123;</span><br><span class="line">				<span class="keyword">if</span>(chess[i][j]!=0) &#123;</span><br><span class="line">					sum++;</span><br><span class="line">				&#125;</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;</span><br><span class="line">	//System.out.println(sum);</span><br><span class="line">		//创建对应的稀疏数组</span><br><span class="line">		int[][] sarray=new int[sum+1][3];</span><br><span class="line">		//给稀疏数组赋值, </span><br><span class="line">		sarray[0][0]=11;</span><br><span class="line">		sarray[0][1]=11;</span><br><span class="line">		sarray[0][2]=sum;</span><br><span class="line">		//遍历原始数组，将chess中非零数据放入稀疏数组</span><br><span class="line">		int count=0;</span><br><span class="line">		<span class="keyword">for</span>(int i=0;i&lt;11;i++) &#123;</span><br><span class="line">			<span class="keyword">for</span>(int j=0;j&lt;11;j++) &#123;</span><br><span class="line">				<span class="keyword">if</span>(chess[i][j]!=0) &#123;</span><br><span class="line">					count++;</span><br><span class="line">					sarray[count][0]=i;</span><br><span class="line">					sarray[count][1]=j;</span><br><span class="line">					sarray[count][2]=chess[i][j];</span><br><span class="line">				&#125;</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;</span><br><span class="line">		System.out.println(<span class="string">"稀疏数组是："</span>);</span><br><span class="line">		<span class="keyword">for</span>(int i=0;i&lt;sarray.length;i++) &#123;</span><br><span class="line">			<span class="keyword">for</span>(int j=0;j&lt;3;j++) &#123;</span><br><span class="line">				System.out.print(<span class="string">" "</span>+sarray[i][j]);</span><br><span class="line">			&#125;</span><br><span class="line">			 System.out.println();</span><br><span class="line">		&#125;</span><br><span class="line">		System.out.println(<span class="string">"**********************************************************"</span>); </span><br><span class="line">		//将稀疏数组还原成原始二维数组</span><br><span class="line">		//先读取稀疏数组的第一行，根据稀疏数组第一行还原原来的二位数组</span><br><span class="line">		int[][] chess1=new int[sarray[0][0]][sarray[0][1]];</span><br><span class="line">		//在读取稀疏数组后面行，将值附给原始数组</span><br><span class="line">		<span class="keyword">for</span>(int i=1;i&lt;sarray.length;i++) &#123;</span><br><span class="line">			chess1[sarray[i][0]][sarray[i][1]]=sarray[i][2];</span><br><span class="line">		&#125;</span><br><span class="line">		<span class="keyword">for</span> (int[] row : chess1) &#123;</span><br><span class="line">			<span class="keyword">for</span> (int data : row) &#123;</span><br><span class="line">				System.out.print(<span class="string">" "</span> + data);</span><br><span class="line">			&#125;</span><br><span class="line">			System.out.println();</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br><span class="line">output:</span><br><span class="line">原始二维数组：</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 1 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 2 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 2 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line">稀疏数组是：</span><br><span class="line"> 11 11 3</span><br><span class="line"> 1 2 1</span><br><span class="line"> 2 3 2</span><br><span class="line"> 4 5 2</span><br><span class="line">**********************************************************</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 1 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 2 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 2 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br><span class="line"> 0 0 0 0 0 0 0 0 0 0 0</span><br></pre></td></tr></table></figure>

      
    </div>
    
  </div>
  
    



  
</article>



<div class="bdsharebuttonbox">
	<a href="#" class="fx fa-weibo bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
	<a href="#" class="fx fa-weixin bds_weixin" data-cmd="weixin" title="分享到微信"></a>
	<a href="#" class="fx fa-qq bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
	<a href="#" class="fx fa-facebook-official bds_fbook" data-cmd="fbook" title="分享到Facebook"></a>
	<a href="#" class="fx fa-twitter bds_twi" data-cmd="twi" title="分享到Twitter"></a>
	<a href="#" class="fx fa-linkedin bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a>
	<a href="#" class="fx fa-files-o bds_copy" data-cmd="copy" title="分享到复制网址"></a>
</div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"2","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>




    
        <section class="changyan" id="comments">
  <!--<div id="uyan_frame"></div>-->
  <div id="SOHUCS"></div>
  <script charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/changyan.js"></script>
  <script type="text/javascript">
    window.changyan.api.config({
      appid: 'xxxx',
      conf: 'xxxxxxxxx'
    });
  </script>
</section>
    






    <script>
        
    </script>

</div>
      <footer id="footer">
    <div class="outer">
        <div id="footer-info">
            <div class="footer-left">
                &copy; 2019 TimeSilence
            </div>
            <div class="footer-right">
                <a href="http://hexo.io/" target="_blank">Hexo &nbsp;&nbsp;</a><a href="https://github.com/maochunguang" target="_blank">Blog</a> by tommy
            </div>
        </div>
        
            <div class="visit">
                
                    <span id="busuanzi_container_site_pv" style="display:none">
                        <span id="site-visit">极客到访数: 
                            <span id="busuanzi_value_site_uv"></span>
                        </span>
                    </span>
                
                
                    <span>, </span>
                
                
                    <span id="busuanzi_container_page_pv" style="display:none">
                        <span id="page-visit">本页阅读量: 
                            <span id="busuanzi_value_page_pv"></span>
                        </span>
                    </span>
                
            </div>
        
    </div>
</footer>

    </div>
    
<script src="https://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js"></script>

<script src="/js/main.js"></script>

    <script>
        $(document).ready(function() {
            var backgroundnum = 2;
            var backgroundimg = "url(/background/bg-x.jpg)".replace(/x/gi, Math.ceil(Math.random() * backgroundnum));
            $("#mobile-nav").css({"background-image": backgroundimg,"background-size": "cover","background-position": "center"});
            $(".left-col").css({"background-image": backgroundimg,"background-size": "cover","background-position": "center"});
        })
    </script>


<!-- Google Analytics -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'xxxxx', 'auto');
ga('send', 'pageview');

</script>
<!-- End Google Analytics -->



	<script>
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?xxxxxx";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
	</script>



<div class="scroll" id="scroll">
    <a href="#"><i class="fa fa-arrow-up"></i></a>
    <a href="#comments"><i class="fa fa-comments-o"></i></a>
    <a href="#footer"><i class="fa fa-arrow-down"></i></a>
</div>
<script>
    $(document).ready(function() {
        if ($("#comments").length < 1) {
            $("#scroll > a:nth-child(2)").hide();
        };
    })
</script>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>

  <script language="javascript">
    $(function() {
        $("a[title]").each(function() {
            var a = $(this);
            var title = a.attr('title');
            if (title == undefined || title == "") return;
            a.data('title', title).removeAttr('title').hover(
            function() {
                var offset = a.offset();
                $("<div id=\"anchortitlecontainer\"></div>").appendTo($("body")).html(title).css({
                    top: offset.top - a.outerHeight() - 15,
                    left: offset.left + a.outerWidth()/2 + 1
                }).fadeIn(function() {
                    var pop = $(this);
                    setTimeout(function() {
                        pop.remove();
                    }, pop.text().length * 800);
                });
            }, function() {
                $("#anchortitlecontainer").remove();
            });
        });
    });
</script>


  </div>
</body>
</html>